<%@ page contentType="text/html;charset=utf-8"%>

<!DOCTYPE html>
<html lang="en" dir="ltl">
<head>
<meta charset="utf-8" />

<%  
	String path = request.getContextPath();  
	String basePath = request.getScheme()+"://"+request.getServerName()+
		(request.getServerPort() == 80 ? "" : (":"+request.getServerPort())) +path+"/";  
%>

<script type="text/javascript">
	var base_path = "<%=basePath%>";
</script>

<base href="<%=basePath%>">
<link rel="stylesheet" href="css/reset.css" />
<link rel="stylesheet" href="css/text.css" />
<link rel="stylesheet" href="css/960.css" />
<link rel="stylesheet" href="css/demo.css" />
<link rel="stylesheet" href="css/style.css" />
<script type='text/javascript' src='js/jquery-1.5.2.min.js'></script>
<script type='text/javascript'>
	$(document).ready(function() {
		
		$("#right").css(
			    "margin-top", function(index, value) {return ($(window).height()-494)/2;}
			  );
		$("#right").height(494);
	});
   function login(){
	   $.ajax({
			url: base_path+"Login/login.do",
			type: "POST",
			data: {"method":"measuring"},
            data: {"userType":$("#userType").val(),"userName":$("#userName").val(),"userPw":$("#userPw").val()}, 
			beforeSend: function(XMLHttpRequest){
				$("#ajaxResult").html("<img src='images/loading.gif'/>");
			},
			success: function(data, textStatus){
				if(data=="success"){
					window.location.href=base_path+"index.jsp";
				}else{
					$("#ajaxResult").html("用户名密码错误");
				}
			},

			complete: function(XMLHttpRequest, textStatus){
//			
			},
			error: function(){
				$("#ajaxResult").html("服务器异常，请联系网络管理员");
			}
		});
   }
</script>

</head>
<body style="padding-bottom:0;margin-bottom:0;background: #123 url(images/login_bg.jpg) no-repeat fixed center;height:100%;">
<div class="container_16" id="container" style="padding-bottom:0;margin-bottom:0;height:100%;BACKGROUND:transparent none repeat scroll 0% 0%;">
 	<div class="grid_10" id="left">
 		&nbsp;
  	</div>
  	<div class="grid_5" style="vertical-align:middle;" id="right">
	  		<div style="width:100%;height:100%;margin:0;padding:0;font-size:13px;">
			  		
	  				<div id="right_top"></div>
	  				<div id="ajaxResult">
					 	
				 	</div>
	  				<div id="right_center">
		  		 		<div id="role">角&nbsp;&nbsp;色&nbsp;&nbsp;
				        	<select id="userType">
				        		<option value="游客" selected>游客</option>
				        		<option value="学生">学生</option>
				        		<option value="教师">教师</option>
				        		<option value="管理员">管理员</option>
				        	</select>
				       </div>
				       <div id="user">帐&nbsp;&nbsp;号&nbsp;&nbsp;
				         <input type="text" name="textfield" value="demo" id="userName">
				       </div>
					   <div id="password">密&nbsp;&nbsp;码&nbsp;&nbsp;
					     <input type="password" name="textfield2" value="demo" id="userPw">
					   </div>
					   <div id="btn">
					   	<a href="javascript:login();">登录</a>
					   	<a href="javascript:void(-1);">清空</a>
					   </div>
					   
			  		</div>
			  		<div id="right_bottom"></div>
			  		
			  		<div style="width:100%;text-align:right;margin-top:0px;font-size:11px;">
			  					  		版本信息 选课系统 2012 demo V1.0
			  		</div>
			  </div>
  	</div>
  	<div class="grid_1">
	  	
  	</div>
</div>
</body>
</html>